<template>
    <rx-dialog @cancel="cancel" :showok="false">
        <a-form :form="form">
            <a-form-item style="display:none">
                <a-input v-decorator="['id']"/>
            </a-form-item>
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('taskLog.logUrl','接口完整路径')">
                {{mdl.logUrl}}
            </a-form-item>
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('taskLog.logHeaders','请求头数据')">
                {{mdl.logHeaders}}
            </a-form-item>
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('taskLog.logQuery','请求路径数据')">
                {{mdl.logQuery}}
            </a-form-item>
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('taskLog.logBody','请求体数据')">
                {{mdl.logBody}}
            </a-form-item>
            <div v-if="mdl.responseState!='200'">
                <h3 style="text-align:center;">{{i18n('taskLog.errorMsg','错误信息')}}</h3>
                <hr />
                <span style="color:red;">{{mdl.errorMessage}}</span>
            </div>
            <div v-else>
                <h3 style="text-align:center;">{{i18n('taskLog.responseData','返回数据')}}</h3>
                <hr />
                <span style="color:green;">{{mdl.responseData}}</span>
            </div>
        </a-form>
    </rx-dialog>
</template>
<script>
    import SysHttpTaskLogApi from '@/api/system/core/sysHttpTaskLog'
    import {BaseForm,RxDialog} from "@lowcode/jpaas-common-lib";
    export default {
        name: 'SysHttpTaskLogDetail',
        mixins:[BaseForm],
        components: {
            RxDialog,
        },
        methods: {
            i18n(name, text, key) {
                return this.$ti18(name, text, "SysHttpTask", key);
            },
            get(id){
                return SysHttpTaskLogApi.get(id);
            },
            save(values){
                return SSysHttpTaskLogApi.save(values);
            }

        }
    }
</script>
